import { App } from 'vue'

// 自动注册成全局组件
export const autoInjectComponent = (app: App) => {
   const components = import.meta.glob('../components/*/*.vue')
   Object.entries(components).forEach(async ([key, value]) => {
      const name = key.split('/').pop()?.split('.').shift() as string
      const component = (await value()) as any
      app.component(name, component.default)
   })
}
